package com.example.pc.routingtestproject.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.TextView;

import com.example.baselibrary.util.router.RouterActivityIntentResourceKey;
import com.example.baselibrary.util.router.RouterTransferCenterUtil;
import com.example.pc.routingtestproject.R;

/**
 * Created by PC on 2018/4/11.
 */

public class StartActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_start);
        TextView tv_ar_text_one = findViewById(R.id.tv_ar_text_one);
        tv_ar_text_one.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = RouterTransferCenterUtil.getInstance().getRouterIntent(StartActivity.this,
                        RouterActivityIntentResourceKey.KEY_MODULE_ONE_ACTIVITY);
                intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
                startActivity(intent);
            }
        });

        TextView tv_ar_text_two = findViewById(R.id.tv_ar_text_two);
        tv_ar_text_two.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = RouterTransferCenterUtil.getInstance().getRouterIntent(StartActivity.this,
                        RouterActivityIntentResourceKey.KEY_MODULE_TWO_ACTIVITY);
                intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
                startActivity(intent);
            }
        });

        findViewById(R.id.tv_ar_text_three).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
//                Intent intent = RouterTransferCenterUtil.getInstance().getRouterIntent(StartActivity.this,
//                        RouterActivityIntentResourceKey.KEY_MODULE_THREE_KOTLIN_ACTIVITY);

//                Intent intent = RouterTransferCenterUtil.getInstance().getRouterIntent(StartActivity.this,
//                        RouterActivityIntentResourceKey.KEY_MODULE_THREE_TEST_ACTIVITY);

                Intent intent = RouterTransferCenterUtil.getInstance().getRouterIntent(StartActivity.this,
                        RouterActivityIntentResourceKey.KEY_MODULE_THREE_ACTIVITY);
                intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
                intent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
                startActivity(intent);
            }
        });


    }
}
